' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2024.09.09.00.00]) on 2026.02.14 at 04:16 (Coordinated Universal Time)
' Using DRAW to help generate an animated conical shape
' This program by Charlie Veniot inspired by a BBC program
' by Richard Russell (shared with the "BASIC Programming Language"
' Facebook group in this post: https://www.facebook.com/share/v/1CDHD7WrKN/)
' The programming goal: generate a similar graph using DRAW instead of
' using trigonometric functions'
_TITLE "BAM"
s% = 250
icc% = s% / 2 - 20
icr% = s% / 2 - 5
ocr% = s% - 5
ainc# = 0
DIM c%(0 TO 23)
FOR i% = 0 TO 23
c%(i%) = INT( RND * 62 + 1 )
NEXT i%
SCREEN _NEWIMAGE( s% * 2 + 1, s% * 2 + 1, 17 )
COLOR INT( RND * 63 + 1)
🟠Endless_Loop_Start:
FOR a2% = 0 TO 359
CLS
DRAW "BM" + s% + "," + s%
DRAW "BTA" + a2% + "U" + icc%
c1x% = POINT(0) : c1y% = POINT(1)
i% = 0
FOR a1% = 0 TO 360 STEP 15
COLOR c%( a1% / 15 )
DRAW "BM" + c1x% + "," + c1y%
DRAW "BTA" + ( a1% + ainc# ) + "U" + icr%
PSET( POINT(0), POINT(1) )
nowx% = POINT(0) : nowy% = POINT(1)
DRAW "BM" + s% + "," + s%
DRAW "BTA" + ( a1% + ainc# ) + "U" + ocr%
PSET( POINT(0), POINT(1) )
nowx2% = POINT(0) : nowy2% = POINT(1)
IF i% MOD 2 = 1 THEN
LINE (s%, s%) TO ((nowx% + lastx%)/2, (nowy% + lasty%) / 2 )
LINE TO ((nowx2% + lastx2%)/2, (nowy2% + lasty2%) / 2 )
LINE (nowx%, nowy%) TO (s%, s%)
LINE TO (lastx%, lasty%)
LINE TO (nowx%, nowy%)
LINE TO (nowx2%, nowy2%)
LINE TO (lastx2%, lasty2%)
LINE TO (lastx%, lasty%)
END IF
i% = i% + 1
lastx% = nowx% : lasty% = nowy%
lastx2% = nowx2% : lasty2% = nowy2%
NEXT a1%
SLEEP 0.01
ainc# = ainc# + 0.1
NEXT a2%
GOTO 🟠Endless_Loop_Start